The Document Object Model (DOM) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and ways for documents to be accessed and manipulated. One objective for DOM is to provide a standard programming interface that can be used in a wide variety of environments and applications. Generally, DOM provides a hierarchical tree structure having a plurality of nodes in parent/child relationships. Using this structure, script programs can examine and dynamically change a web page.
Other languages can be associated with object models different than DOM. However, whatever model is used, it is desirable to allow programmers to build documents, navigate their structure, and add, modify, or delete elements and content.
Even with well-defined object models, authoring pages that can be used across different platforms can be challenging. For example, different pages often need to be created based on whether the page is to be displayed on a server or a client, despite an overlap in content between the pages. In one simple example, a server-side page can display headers and footers that are not displayed on a client page. In such a situation, two different pages need to be created even if the content is the same.